package com.gupaoedu.pattern.observer.gper;

import java.util.Observable;
import java.util.Observer;

/**
 * 2019/9/28
 * created by chenpp
 */
public class Teacher implements Observer {

    private String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Teacher(String name){
        this.name = name;
    }

    /**
     * @param o   the observable object.
     * @param arg an argument passed to the <code>notifyObservers</code>
     */
    public void update(Observable o, Object arg) {
        GPer gper = (GPer) o;
        Question question = (Question)arg;
        System.out.println("===========================================");
        System.out.println(this.name+"老师,你收到了学员"+question.getName()+"的一个问题，\n"
        +"内容为:"+question.getContent());
    }
}
